<script>
	export default {
		onLaunch: function() {
			console.log('App onLaunch');
			uni.hideTabBar();
			// #ifdef APP-PLUS
			const platform = uni.getSystemInfoSync().osName
			// 判断是不是ios，并且是否同意了隐私政策
			let agree = uni.getStorageSync('agree')
			if (platform === 'android' || agree) {
				// #ifdef APP-PLUS
				plus.navigator.closeSplashscreen() // 关闭启动页
				// #endif
			} else {
				// ios单独进行隐私政策验证
				uni.navigateTo({
					url: "/pages/iosPrivacy/iosPrivacy",
					success() {
						// #ifdef APP-PLUS
						plus.navigator.closeSplashscreen() // 关闭启动页，解决先跳转首页再显示隐私政策的问题
						// #endif
					}
				})
			}
			// #endif 			
		},
		onShow: function() {
			// #ifdef APP-PLUS
			const args = plus.runtime.arguments;
			if(args) {
				console.log(args)
				uni.navigateTo({
					url:args.replace('hbuilder:/','').replace('moliang:/',''),
					complete() {
						plus.runtime.arguments = null;
						plus.runtime.arguments = '';
					}
				})
			}
			// #endif
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "tailwindcss/base";
	@import "tailwindcss/utilities";
	@import "@/uni_modules/uview-plus/index.scss";

	page {
		background-color: #f8f8f8;
	}

	.pb-safe {
		padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
		/* 兼容 iOS < 11.2 */
		padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
		/* 兼容 iOS >= 11.2 */
	}

	.pb-safe-nopadding {
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容 iOS < 11.2 */
		padding-bottom: env(safe-area-inset-bottom);
		/* 兼容 iOS >= 11.2 */
	}
</style>